package com.seraph.zys.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.seraph.bi.suite.support.domain.pagination.PageBox;
import com.seraph.bi.suite.support.domain.pagination.PageObject;
import com.seraph.bi.suite.support.domain.tree.AsyncTreeNode;
import com.seraph.zys.dao.ScTreeMenuDAO;
import com.seraph.zys.dao.domain.ScTreeMenu;
import com.seraph.zys.dao.domain.ScTreeMenuExample;

@Repository
public class ScTreeMenuDAOImpl extends SqlMapClientDaoSupport implements ScTreeMenuDAO {

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public ScTreeMenuDAOImpl() {
        super();
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public Integer insert(ScTreeMenu record) {
        Object newKey = getSqlMapClientTemplate().insert("sc_tree_menu.abatorgenerated_insert", record);
        return (Integer) newKey;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKey(ScTreeMenu record) {
        int rows = getSqlMapClientTemplate().update("sc_tree_menu.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKeySelective(ScTreeMenu record) {
        int rows = getSqlMapClientTemplate().update("sc_tree_menu.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public List selectByExample(ScTreeMenuExample example, String orderByClause) {
        Map parms = getExampleParms(example);
        if (orderByClause != null) {
            parms.put("ABATOR_ORDER_BY_CLAUSE", orderByClause);
        }
        List list = getSqlMapClientTemplate().queryForList("sc_tree_menu.abatorgenerated_selectByExample", parms);
        return list;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public List selectByExample(ScTreeMenuExample example) {
        return selectByExample(example, null);
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public ScTreeMenu selectByPrimaryKey(Integer id) {
        ScTreeMenu key = new ScTreeMenu();
        key.setId(id);
        ScTreeMenu record = (ScTreeMenu) getSqlMapClientTemplate().queryForObject("sc_tree_menu.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int deleteByExample(ScTreeMenuExample example) {
        int rows = getSqlMapClientTemplate().delete("sc_tree_menu.abatorgenerated_deleteByExample", getExampleParms(example));
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int deleteByPrimaryKey(Integer id) {
        ScTreeMenu key = new ScTreeMenu();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("sc_tree_menu.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getIDExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getId_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NULL", "Y");
            } else {
                parms.put("AND_ID_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NOT_NULL", "Y");
            } else {
                parms.put("AND_ID_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_EQUALS", "Y");
            } else {
                parms.put("AND_ID_EQUALS", "Y");
            }
            parms.put("id", example.getId());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_ID_NOT_EQUALS", "Y");
            }
            parms.put("id", example.getId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_GT", "Y");
            } else {
                parms.put("AND_ID_GT", "Y");
            }
            parms.put("id", example.getId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_GE", "Y");
            } else {
                parms.put("AND_ID_GE", "Y");
            }
            parms.put("id", example.getId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_LT", "Y");
            } else {
                parms.put("AND_ID_LT", "Y");
            }
            parms.put("id", example.getId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_LE", "Y");
            } else {
                parms.put("AND_ID_LE", "Y");
            }
            parms.put("id", example.getId());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getMENU_IDExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getMenuId_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_NULL", "Y");
            } else {
                parms.put("AND_MENU_ID_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_NOT_NULL", "Y");
            } else {
                parms.put("AND_MENU_ID_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_EQUALS", "Y");
            } else {
                parms.put("AND_MENU_ID_EQUALS", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_MENU_ID_NOT_EQUALS", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_GT", "Y");
            } else {
                parms.put("AND_MENU_ID_GT", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_GE", "Y");
            } else {
                parms.put("AND_MENU_ID_GE", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_LT", "Y");
            } else {
                parms.put("AND_MENU_ID_LT", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_MENU_ID_LE", "Y");
            } else {
                parms.put("AND_MENU_ID_LE", "Y");
            }
            parms.put("menuId", example.getMenuId());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getPARENT_IDExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getParentId_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_NULL", "Y");
            } else {
                parms.put("AND_PARENT_ID_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_NOT_NULL", "Y");
            } else {
                parms.put("AND_PARENT_ID_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_EQUALS", "Y");
            } else {
                parms.put("AND_PARENT_ID_EQUALS", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_PARENT_ID_NOT_EQUALS", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_GT", "Y");
            } else {
                parms.put("AND_PARENT_ID_GT", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_GE", "Y");
            } else {
                parms.put("AND_PARENT_ID_GE", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_LT", "Y");
            } else {
                parms.put("AND_PARENT_ID_LT", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_PARENT_ID_LE", "Y");
            } else {
                parms.put("AND_PARENT_ID_LE", "Y");
            }
            parms.put("parentId", example.getParentId());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getTEXTExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getText_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_NULL", "Y");
            } else {
                parms.put("AND_TEXT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_NOT_NULL", "Y");
            } else {
                parms.put("AND_TEXT_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_EQUALS", "Y");
            } else {
                parms.put("AND_TEXT_EQUALS", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_TEXT_NOT_EQUALS", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_GT", "Y");
            } else {
                parms.put("AND_TEXT_GT", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_GE", "Y");
            } else {
                parms.put("AND_TEXT_GE", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_LT", "Y");
            } else {
                parms.put("AND_TEXT_LT", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_LE", "Y");
            } else {
                parms.put("AND_TEXT_LE", "Y");
            }
            parms.put("text", example.getText());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TEXT_LIKE", "Y");
            } else {
                parms.put("AND_TEXT_LIKE", "Y");
            }
            parms.put("text", example.getText());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getLEAFExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getLeaf_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_NULL", "Y");
            } else {
                parms.put("AND_LEAF_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_NOT_NULL", "Y");
            } else {
                parms.put("AND_LEAF_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_EQUALS", "Y");
            } else {
                parms.put("AND_LEAF_EQUALS", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_LEAF_NOT_EQUALS", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_GT", "Y");
            } else {
                parms.put("AND_LEAF_GT", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_GE", "Y");
            } else {
                parms.put("AND_LEAF_GE", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_LT", "Y");
            } else {
                parms.put("AND_LEAF_LT", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_LE", "Y");
            } else {
                parms.put("AND_LEAF_LE", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LEAF_LIKE", "Y");
            } else {
                parms.put("AND_LEAF_LIKE", "Y");
            }
            parms.put("leaf", example.getLeaf());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getDISABLEDExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getDisabled_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_NULL", "Y");
            } else {
                parms.put("AND_DISABLED_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_NOT_NULL", "Y");
            } else {
                parms.put("AND_DISABLED_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_EQUALS", "Y");
            } else {
                parms.put("AND_DISABLED_EQUALS", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_DISABLED_NOT_EQUALS", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_GT", "Y");
            } else {
                parms.put("AND_DISABLED_GT", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_GE", "Y");
            } else {
                parms.put("AND_DISABLED_GE", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_LT", "Y");
            } else {
                parms.put("AND_DISABLED_LT", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_LE", "Y");
            } else {
                parms.put("AND_DISABLED_LE", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_DISABLED_LIKE", "Y");
            } else {
                parms.put("AND_DISABLED_LIKE", "Y");
            }
            parms.put("disabled", example.getDisabled());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getCLSExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getCls_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_NULL", "Y");
            } else {
                parms.put("AND_CLS_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_NOT_NULL", "Y");
            } else {
                parms.put("AND_CLS_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_EQUALS", "Y");
            } else {
                parms.put("AND_CLS_EQUALS", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_CLS_NOT_EQUALS", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_GT", "Y");
            } else {
                parms.put("AND_CLS_GT", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_GE", "Y");
            } else {
                parms.put("AND_CLS_GE", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_LT", "Y");
            } else {
                parms.put("AND_CLS_LT", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_LE", "Y");
            } else {
                parms.put("AND_CLS_LE", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_CLS_LIKE", "Y");
            } else {
                parms.put("AND_CLS_LIKE", "Y");
            }
            parms.put("cls", example.getCls());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getICON_CLSExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getIconCls_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_NULL", "Y");
            } else {
                parms.put("AND_ICON_CLS_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_NOT_NULL", "Y");
            } else {
                parms.put("AND_ICON_CLS_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_EQUALS", "Y");
            } else {
                parms.put("AND_ICON_CLS_EQUALS", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_ICON_CLS_NOT_EQUALS", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_GT", "Y");
            } else {
                parms.put("AND_ICON_CLS_GT", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_GE", "Y");
            } else {
                parms.put("AND_ICON_CLS_GE", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_LT", "Y");
            } else {
                parms.put("AND_ICON_CLS_LT", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_LE", "Y");
            } else {
                parms.put("AND_ICON_CLS_LE", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ICON_CLS_LIKE", "Y");
            } else {
                parms.put("AND_ICON_CLS_LIKE", "Y");
            }
            parms.put("iconCls", example.getIconCls());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getHREFExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getHref_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_NULL", "Y");
            } else {
                parms.put("AND_HREF_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_NOT_NULL", "Y");
            } else {
                parms.put("AND_HREF_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_EQUALS", "Y");
            } else {
                parms.put("AND_HREF_EQUALS", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_HREF_NOT_EQUALS", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_GT", "Y");
            } else {
                parms.put("AND_HREF_GT", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_GE", "Y");
            } else {
                parms.put("AND_HREF_GE", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_LT", "Y");
            } else {
                parms.put("AND_HREF_LT", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_LE", "Y");
            } else {
                parms.put("AND_HREF_LE", "Y");
            }
            parms.put("href", example.getHref());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_LIKE", "Y");
            } else {
                parms.put("AND_HREF_LIKE", "Y");
            }
            parms.put("href", example.getHref());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getVISIBILITYExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getVisibility_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_NULL", "Y");
            } else {
                parms.put("AND_VISIBILITY_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_NOT_NULL", "Y");
            } else {
                parms.put("AND_VISIBILITY_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_EQUALS", "Y");
            } else {
                parms.put("AND_VISIBILITY_EQUALS", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_VISIBILITY_NOT_EQUALS", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_GT", "Y");
            } else {
                parms.put("AND_VISIBILITY_GT", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_GE", "Y");
            } else {
                parms.put("AND_VISIBILITY_GE", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_LT", "Y");
            } else {
                parms.put("AND_VISIBILITY_LT", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_LE", "Y");
            } else {
                parms.put("AND_VISIBILITY_LE", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_VISIBILITY_LIKE", "Y");
            } else {
                parms.put("AND_VISIBILITY_LIKE", "Y");
            }
            parms.put("visibility", example.getVisibility());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getTYPEExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getType_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_NULL", "Y");
            } else {
                parms.put("AND_TYPE_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_NOT_NULL", "Y");
            } else {
                parms.put("AND_TYPE_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_EQUALS", "Y");
            } else {
                parms.put("AND_TYPE_EQUALS", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_TYPE_NOT_EQUALS", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_GT", "Y");
            } else {
                parms.put("AND_TYPE_GT", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_GE", "Y");
            } else {
                parms.put("AND_TYPE_GE", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_LT", "Y");
            } else {
                parms.put("AND_TYPE_LT", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_LE", "Y");
            } else {
                parms.put("AND_TYPE_LE", "Y");
            }
            parms.put("type", example.getType());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_TYPE_LIKE", "Y");
            } else {
                parms.put("AND_TYPE_LIKE", "Y");
            }
            parms.put("type", example.getType());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getSORTExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getSort_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_NULL", "Y");
            } else {
                parms.put("AND_SORT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_NOT_NULL", "Y");
            } else {
                parms.put("AND_SORT_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_EQUALS", "Y");
            } else {
                parms.put("AND_SORT_EQUALS", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_SORT_NOT_EQUALS", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_GT", "Y");
            } else {
                parms.put("AND_SORT_GT", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_GE", "Y");
            } else {
                parms.put("AND_SORT_GE", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_LT", "Y");
            } else {
                parms.put("AND_SORT_LT", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_SORT_LE", "Y");
            } else {
                parms.put("AND_SORT_LE", "Y");
            }
            parms.put("sort", example.getSort());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getHREF_TARGETExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        switch (example.getHrefTarget_Indicator()) {
        case ScTreeMenuExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_NULL", "Y");
            } else {
                parms.put("AND_HREF_TARGET_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_NOT_NULL", "Y");
            } else {
                parms.put("AND_HREF_TARGET_NOT_NULL", "Y");
            }
            break;
        case ScTreeMenuExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_EQUALS", "Y");
            } else {
                parms.put("AND_HREF_TARGET_EQUALS", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_HREF_TARGET_NOT_EQUALS", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_GT", "Y");
            } else {
                parms.put("AND_HREF_TARGET_GT", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_GE", "Y");
            } else {
                parms.put("AND_HREF_TARGET_GE", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_LT", "Y");
            } else {
                parms.put("AND_HREF_TARGET_LT", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_LE", "Y");
            } else {
                parms.put("AND_HREF_TARGET_LE", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        case ScTreeMenuExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_HREF_TARGET_LIKE", "Y");
            } else {
                parms.put("AND_HREF_TARGET_LIKE", "Y");
            }
            parms.put("hrefTarget", example.getHrefTarget());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getExampleParms(ScTreeMenuExample example) {
        Map parms = new HashMap();
        parms.putAll(getIDExampleParms(example));
        parms.putAll(getMENU_IDExampleParms(example));
        parms.putAll(getPARENT_IDExampleParms(example));
        parms.putAll(getTEXTExampleParms(example));
        parms.putAll(getLEAFExampleParms(example));
        parms.putAll(getDISABLEDExampleParms(example));
        parms.putAll(getCLSExampleParms(example));
        parms.putAll(getICON_CLSExampleParms(example));
        parms.putAll(getHREFExampleParms(example));
        parms.putAll(getVISIBILITYExampleParms(example));
        parms.putAll(getTYPEExampleParms(example));
        parms.putAll(getSORTExampleParms(example));
        parms.putAll(getHREF_TARGETExampleParms(example));
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int selectCountByExample(ScTreeMenuExample example) {
        Map parms = getExampleParms(example);
        int count = ((Integer)getSqlMapClientTemplate().queryForObject("sc_tree_menu.abatorgenerated_selectCountByExample", parms)).intValue();
        return count;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public PageBox selectByExampleWithPaging(ScTreeMenuExample example, int pageSize, int pageNum, String orderByClause) {
        Map parms = getExampleParms(example);
        if (orderByClause != null) {
            parms.put("ABATOR_ORDER_BY_CLAUSE", orderByClause);
        }
        PageBox pageBox = new PageBox();
        PageObject pageObject = new PageObject();
        pageObject.setPageSize(pageSize);
        pageObject.setPageIndex(pageNum);
        int itemAmount = selectCountByExample(example);
        pageObject.setItemAmount(itemAmount);
        List pageList = null;
        if (pageObject.getBeginIndex() <= pageObject.getItemAmount()) {
            pageList = (getSqlMapClientTemplate().queryForList("sc_tree_menu.abatorgenerated_selectByExample", parms, pageObject.getBeginIndex() - 1, pageSize));
        }
        pageBox.setPageObject(pageObject);
        pageBox.setPageList(pageList);
        return pageBox;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public PageBox selectByExampleWithPaging(ScTreeMenuExample example, int pageSize, int pageNum) {
        return selectByExampleWithPaging(example, pageSize, pageNum, null);
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table sc_tree_menu
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKeyForCgs(ScTreeMenu record) {
        int rows = getSqlMapClientTemplate().update("sc_tree_menu.abatorgenerated_updateByPrimaryKeyForCgs", record);
        return rows;
    }
    
    public List<AsyncTreeNode> selectLowerTreeMenuNodeByAuthorities(int menuId,
			String username) {
		Map parms = new HashMap();
		parms.put("menuId", menuId);
		parms.put("username", username);

		List list = getSqlMapClientTemplate().queryForList("sc_tree_menu.selectLowerTreeMenuNodeByAuthorities", parms);
		return list;
	}
    
}